<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns="http://www.w3.org/1999/xhtml" lang="en">

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta http-equiv="Content-language" content="zh-CN" />
    <meta name="format-detection" content="telephone=no" />
    <meta name="applicable-device" content="pc">
    <link href="/static/img/logo500x500.png" rel="shortcut icon" sizes="500x500">
    <title th:text="${house.title}"></title>
    <!--地址信息-->
    <meta name="location" content="province=山东;city=青岛">
    <meta name="" mobile-agent content="format=[wml|xhtml|html5];url=https://m.ke.com/chuzu/qd/zufang/QD2082519643314470912.html" />
    <link rel="alternate" media="only screen and (max-width:640px)" href="https://m.ke.com/chuzu/qd/zufang/QD2082519643314470912.html">
    <!-- 是否需要加载common.css -->
    <link rel="stylesheet" href="/static/css/common.css">
    <!-- 载入后台返回的css文件 -->
    <link rel="stylesheet" href="/static/css/index01.css">
    <!-- 载入后台返回的css文件 -->
    <link rel="stylesheet" href="/static/css/index02.css">

    <!-- 载入链家相关皮肤 -->
    <link rel="stylesheet" href="/static/css/lianjia.css">
    <link property="stylesheet" rel="stylesheet" href="/static/css/zhu.css">

    <style>
        .black_overlay{
            display: none;
            position: absolute;
            top: 0%;
            left: 0%;
            width: 100%;
            height: 100%;
            background-color: black;
            z-index:1001;
            -moz-opacity: 0.8;
            opacity:.80;
            filter: alpha(opacity=88);
        }
        .white_content {
            display: none;
            position: absolute;
            top: 10%;
            left: 40%;
            width: 300px;
            height:300px
        ;
            padding: 20px;
            border: 10px solid orange;
            background-color: white;
            z-index:1002;
            overflow: auto;
        }
    </style>
    <script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script>
</head>

<body>
<div th:replace="common/head.html::banner(${user})"></div>
    <div class="wrapper">

        <div >

            <!-- 房源有效时 -->
            <div class="content clear w1150">

                <!-- 房源标题 -->
                <p class="content__title" th:text="${house.title}"></p>

                <!-- 房源副标题 -->
                <div class="content__subtitle">
                    发布时间：<p th:text="${house.createTime}"></p>
                    <p style="cursor: pointer" onclick = "document.getElementById('light2').style.display='block';document.getElementById('fade2').style.display='block'">我要举报</p>
                    <br/>

                </div>

                <div class="content__core">

                    <!-- 房源图片轮播图 -->
                    <div class="content__article__slide" id="mySwipe">

                        <!-- 房源大图 -->
                        <ul class="content__article__slide__wrapper">
                            <div class="content__article__slide__item" data-el="slideItem">
                                <a th:href="@{/house/views(id=${house.getId()})}" target="_blank" class="vr-detail-logo">
                                    <img th:src="${house.mainImage}" data-el="lazy-img" height="390px"
                                    />
                                    <i class="vr-animation"></i>
                                </a>
                            </div>


                        </ul>
                    </div>

                    <div class="content__aside fr" id="aside">

                        <!-- 租金及支付方式 -->
                        <div class="content__aside--title">
                            <span th:text="${house.price}"></span>元/月
                            <div class="operate-box">
                                <div>
                                    <button id="" type="button" class="btn btn-default" style="width:70px;
height:48px;
background:rgb(253,161,25);
border-radius:8px;" >
                                        <span style="cursor: pointer;width:31px;height:10px;font-size:10px;font-weight:600;color:rgba(255,255,255,1);line-height:21px;" onclick = "document.getElementById('light').style.display='block';document.getElementById('fade').style.display='block'">我想要</span></button>
                                </div>
                                <!-- 房源关注入口及hover浮层 -->
                                <div class="operate-item">

                                </div>
                            </div>
                        </div>
                        <!-- 房源标签列表 -->
                        <p class="content__aside--tags">
                            <i class="content__item__tag--is_key" th:each="tag:${tags}" th:text="${tag}">随时看房</i>
                        </p>
                        <!-- 房源户型、朝向、面积、租赁方式 -->
                        <ul class="content__aside__list">
                            <li><span class="label">租赁方式：<p th:text="${house.payType}"></p></span></li>
                            <li><span class="label">房屋类型：<p th:text="${house.type}"></p></span></li>
                        </ul>


                    </div>
                </div>

                <div class="content__detail">
                    <div class="content__article fl">

                        <!-- 房源描述 -->
                        <div class="content__article__info3" id="desc">
                            <h3>房源描述</h3>

                            <p th:text="${house.inf}"></p>
                        </div>
                        <!-- 房源图片 -->
                        <div class="content__article__info3" id="desc">
                            <h3>房源照片</h3>
                            <ul class="piclist" data-el="detail-pic">
                                <li th:each="image,iterStat:${imageList}" th:data-index="${iterStat.index}">
                                    <img th:src="${image.url}" />
                                </li>

                            </ul>
                        </div>
                        <!-- 费用详情 -->
                        <div class="content__article__info3 cost_box" id="cost">
                            <h3>费用详情</h3>
                            <div class="cost_content" data-el="costEl">
                                <div class="price_title">
                                    <p class="title_info">年租价 当租期不足1年时租金可能会上浮，详询管家</p>
                                </div>
                                <div class="table_wrapper " data-el="foldEl">
                                    <ul class="table_title">
                                        <li class="table_col">付款方式 <span class="sub_title"></span></li>
                                        <li class="table_col">租金 <span class="sub_title">(元/月)</span></li>


                                    </ul>
                                    <div class="table_content">
                                        <ul class="table_row">
                                            <li class="table_col font_gray" th:text="${house.payType}"></li>
                                            <li class="table_col font_orange" th:text="${house.price}">1000</li>

                                        </ul>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <!-- 房源地址与交通 -->
            <!-- 地址信息 -->
            <div class="content__article__info4 w1150" id="around">
                <h3 onclick="search()">地址和交通</h3>
                <p th:text="${house.getAreaUrl()}"><p>
                <ul class="nav_list" data-el="nav_list">
                </ul>
                <!-- 地图插件显示 -->
                <div class="content__map">
                    <div id="map" class="content__map--container" >
                        <iframe id="mapshow" width="100%" height="480px" src=""></iframe>
                    </div>
                    <script th:inline="javascript">
                        $(document).onReady(
                            $.ajax({
                            url:'//restapi.amap.com/v3/geocode/geo',
                            method:"get",
                            data:{
                                key:"62889ccac3dcb37a045955cf3bb8a3b4",
                                address:[[${house.getAreaUrl()}]]
                            },
                            success:function (result) {
                                let geolocation = result["geocodes"]["0"]["location"];
                                $("#mapshow").attr("src","//m.amap.com/navi/?dest="+geolocation+"&destName="+[[${house.getAreaUrl()}]]+"&hideRouteIcon=1&key=9973e3f3561fe04a1bfd1e5e16e23247")
                            }
                        }))
                    </script>
                </div>
                <ul>
                </ul>
            </div>
        </div>
    </div>
    </div>
        <div id="light" class="white_content">
            <div class="input-group" style="text-align:center;margin:0 auto;padding-top: 5%">
                <img alt="点击头像前去留言" onclick="goto()" style="width: 60px;height: 60px" th:src="${userInf.getProfill()}">
            </div>
            <div class="input-group" style="margin:0 auto;padding-top: 5%">
                <!--<span class="input-group-addon"  style="background-color: white">姓名</span>-->
                <input type="text" class="form-control" id="telphone" placeholder="联系方式"
                       style="width:299px; height:44px; background:rgba(255,255,255,1); box-shadow:0px 2px 4px 0px rgba(153,153,153,0.1); border-radius:8px;">
            </div>
            <div class="input-group" style="margin:0 auto;padding-top: 5%">
                <!--<span class="input-group-addon"  style="background-color: white">姓名</span>-->
                <input type="text" class="form-control" id="price" placeholder="期望价格"
                       style="width:299px; height:44px; background:rgba(255,255,255,1); box-shadow:0px 2px 4px 0px rgba(153,153,153,0.1); border-radius:8px;">
            </div>
            <div class="input-group" style="margin:0 auto;padding-top: 5%">
                <!--<span class="input-group-addon"  style="background-color: white">姓名</span>-->
                <input type="textarea" class="form-control" id="need" placeholder="具体需求"
                       style="width:299px; height:44px; background:rgba(255,255,255,1); box-shadow:0px 2px 4px 0px rgba(153,153,153,0.1); border-radius:8px;">
                <input type="hidden" id="houseId" th:value="${house.id}">
                <input type="hidden" id="userId" th:value="${userinf1.getUserLoginId()}">
            </div>
            <div class="input-group" style="margin:0 auto;padding-top: 5%">
                <div style="display: inline">
                    <button  type="button" class="btn btn-default" style="width:300px;
height:48px;
background:rgba(56,8,8,1);
border-radius:8px;" onclick="save()">
            <span style="width:31px;
height:21px;
font-size:15px;
font-family:PingFangSC-Semibold,PingFang SC;
font-weight:600;
color:rgba(255,255,255,1);
line-height:21px;
text-shadow:0px 2px 4px rgba(134,253,133,0.3);" >保存</span>
                    </button>

                </div>
            </div>
        </div>
        <div id="fade" class="black_overlay">

        </div>
    <div id="light2" class="white_content">

        <div class="input-group" style="text-align:center;margin:0 auto;padding-top: 5%">
            <!--<span class="input-group-addon"  style="background-color: white">姓名</span>-->
            <input type="radio"  name="result"  value="虚假消息">虚假
            <input type="radio"  name="result"  value="黄色消息">涉黄
            <input type="radio"  name="result"  value="非法消息">非法


        </div>
        <div class="input-group" style="margin:0 auto;padding-top: 5%">
            <!--<span class="input-group-addon"  style="background-color: white">姓名</span>-->
            <input type="text" class="form-control" id="inf" placeholder="详细描述"
                   style="width:299px; height:44px; background:rgba(255,255,255,1); box-shadow:0px 2px 4px 0px rgba(153,153,153,0.1); border-radius:8px;">
        </div>
        <div class="input-group" style="margin:0 auto;padding-top: 5%">
            <div style="display: inline">
                <button  type="button" class="btn btn-default" style="width:300px;
height:48px;
background:rgba(56,8,8,1);
border-radius:8px;" onclick="saveResult()">
            <span style="width:31px;
height:21px;
font-size:15px;
font-family:PingFangSC-Semibold,PingFang SC;
font-weight:600;
color:rgba(255,255,255,1);
line-height:21px;
text-shadow:0px 2px 4px rgba(134,253,133,0.3);" >提交</span>
                </button>

            </div>
        </div>
    </div>
    <div id="fade2" class="black_overlay"></div>

</body>
<script th:inline="javascript">
    function save() {
        var houseId=$('#houseId').val();
        var userId=$('#userId').val();
        var telphone=$('#telphone').val();
        var price=$('#price').val();
        var inf=$('#need').val();
        $.ajax({
            url:'/house/user/news',
            type:'POST',
            dataType:'json',
            data:{telphone:telphone,inf:inf,userId:userId,houseId:houseId,price:price},
            success:function(data){
                //请求成功后执行的代码
                alert("提交成功");
                document.getElementById('light').style.display='none';document.getElementById('fade').style.display='none'
            },
            error:function(status){
                //失败后执行的代码
            }
        });

    }
    function saveResult() {
        var result = $('input[name=result]:checked').val();
        var houseId=$('#houseId').val();
        var inf=$('#inf').val();
        var userId=$('#userId').val();
        $.ajax({
            url:'/house/api/accusat',
            type:'POST',
            dataType:'json',
            data:{userId: userId,result:result,houseId:houseId,inf:inf},
            success:function(data){
                //请求成功后执行的代码
                alert("提交成功");
                document.getElementById('light2').style.display='none';document.getElementById('fade2').style.display='none'
            },
            error:function(status){
                //失败后执行的代码
            }
        });

    }

    function goto() {
        var goUser=[[${userInf.getUserLoginId()}]];
        window.location.href="/user/liuyan?userId="+goUser;
    }

</script>

</html>